<%--
  Created by IntelliJ IDEA.
  User: cyy
  Date: 2022/11/22
  Time: 9:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.cyy.bean.product" %>
<%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>
<!DOCTYPE html>
<html>
<head>
        <title>购物商城</title>
</head>

<body>
    <rapid:override name="mainContent">
        <section class="featured spad" style="height: 70px;">
            <div class="container">
                <div class="row featured__filter">
                    <div class="row">
                        <%
                            ArrayList<product> products=(ArrayList<product>)request.getAttribute("products");
                            for(int i=0;i<products.size();i++)
                            {%>
                        <div class="col-lg-3 col-md-4 col-sm-6" style="padding-bottom: 5px;">
                            <div class="product-item">
                                <div class="product-title">
                                    <a href="#"><%=products.get(i).getName()%></a>
                                </div>
                                <div class="product-image">
                                    <a href="#">
                                        <img src=<%=products.get(i).getCover()%>>
                                    </a>
<%--                                    添加到购物车/收藏夹的图标--%>
                                    <div class="product-action">
                                        <a href="/addToCart?productName=<%=products.get(i).getName()%>&price=<%=products.get(i).getPrice()%>"> <i class="fa fa-cart-plus"></i></a>
                                        <a href="/addToCollect?productName=<%=products.get(i).getName()%>&price=<%=products.get(i).getPrice()%>"><i class="fa fa-heart"></i></a>
                                    </div>
                                </div>
<%--                                立即购买的按钮--%>
                                <div class="product-price">
                                    <h3><span></span>$<%=products.get(i).getPrice()%></h3>
                                    <a class="btn" href="addToHistory?productName=<%=products.get(i).getName()%>&price=<%=products.get(i).getPrice()%>"><i class="fa fa-shopping-cart"></i>Buy Now</a>
                                </div>
                            </div>
                        </div>
                        <%}%>
                    </div>
                </div>
            </div>
        </section>
    </rapid:override>
    <%@ include file="customerMenuBarIndex.jsp"%>
</body>
</html>
